﻿using System.ComponentModel.Composition;
using Caliburn.Micro;

namespace NathansMapInfoProjects.PluginManager.ViewModels
{
    /// <summary>
    /// The main view model for the application.
    /// </summary>
    [Export(typeof(IShell))]
    public class ShellViewModel : Conductor<Screen>, IShell
    {
        private readonly ApplicationsViewModel applications_view_model;
        private readonly RepositoresViewModel repositores_view_model;

        [ImportingConstructor]
        public ShellViewModel(ApplicationsViewModel applicationsViewModel,RepositoresViewModel repositoresViewModel)
        {
            applications_view_model = applicationsViewModel;
            repositores_view_model = repositoresViewModel;
        }

        /// <summary>
        /// Switches the view the application list.
        /// </summary>
        public void ApplicationsScreen()
        {
            ActivateItem(this.applications_view_model);
        }

        /// <summary>
        /// Switches the view to the repository list.
        /// </summary>
        public void RepositoresScreen()
        {
            ActivateItem(this.repositores_view_model);
        }
    }
}
